/*---------------------------------------------------------------------------*/
//       Author : hiyohiyo
//         Mail : hiyohiyo@crystalmark.info
//          Web : http://crystalmark.info/
//      License : The modified BSD license
//
//                           Copyright 2002-2004 hiyohiyo, All rights reserved.
/*---------------------------------------------------------------------------*/

#ifndef	_MULTIPLIER_TABLE_
#define	_MULTIPLIER_TABLE_

////////////////////////////////////////////////////////
// LongHaul Table
////////////////////////////////////////////////////////

static BYTE LongHaulNehemiah[32] = {
	20, 32,  8, 18, 19,  0,  9, 11,
	12, 14, 16, 10, 13, 15, 17, 24,
	20, 22, 24, 18, 21, 23, 25, 27,
	28, 30, 32, 26, 29, 31,  0,  0
};

static BYTE LongHaulEzraT[32] = {
	20,  6,  8, 18, 19,  7,  9, 11,
	12, 14, 16, 10, 13, 15, 17, 24,
	20, 22, 24, 18, 21, 23, 25, 27,
	28, 30, 32, 26, 29, 31,  0,  0
};

static BYTE LongHaulEzra[16] = {
	20,  6,  8, 18, 19,  7,  9, 11,
	12, 14, 16, 10, 13, 15, 17, 24
};

static BYTE LongHaulSamuel2[16] = {
	20,  6,  8, 18, 19,  7,  9, 11,
	12, 14, 16, 10, 13, 15, 17, 24
};

static BYTE LongHaulSamuel[16] = {
	 0,  6,  8,  0,  0,  7,  9, 11,
	12, 14, 16, 10, 13, 15,  0,  0
};

////////////////////////////////////////////////////////
// Multiplier Table
////////////////////////////////////////////////////////
static BYTE MultiTableNehemiah[32] = {
	10,  6,  8, 20, 11,  7,  9, 19,
	18, 14, 16, 12, 24, 15, 17, 13,
	18, 22, 24, 20, 27, 23, 25, 21,
	26, 30, 32, 28, 24, 31, 26, 29
};

static BYTE MultiTableEzraT[32] = {
	10,  6,  8, 20, 11,  7,  9, 19,
	18, 14, 16, 12, 24, 15, 17, 13,
	18, 22, 24, 20, 27, 23, 25, 21,
	26, 30, 32, 28, 24, 31, 26, 29
};

static BYTE MultiTableEzra[16] = {
	10,  6,  8, 20, 11,  7,  9, 19,
	18, 14, 16, 12, 24, 15, 17, 13
};

/* Wrong Data ???
static BYTE MultiTableSamuel2[16] =	{
	10,  6,  8, 20, 11,  7,  9, 22,
	18, 14, 16, 12, 24, 15, 26, 13
};
*/

// Thanks Kunishiko. Samuel2 [671]
static BYTE MultiTableSamuel2[16] =	{
	10,  6,  8, 20, 11,  7,  9, 19,
	18, 14, 16, 12, 24, 15, 17, 13
};

/* Wrong Data ???
static BYTE MultiTableCyrix3[16] =	{ // Samuel
	10,  6,  8, 20, 11,  7,  9, 22,
	18, 14, 16, 12, 24, 15, 26, 13
};
*/

// ???
static BYTE MultiTableCyrix3[16] =	{ // Samuel
	10,  6,  8, 20, 11,  7,  9, 19,
	18, 14, 16, 12, 24, 15, 17, 13
};

static BYTE MultiTableK6[8]  = {
	9, 10,  8, 11,  5,  6, 12,  7
};

static BYTE MultiTableK6M13[8] = {
	9, 10,  8, 11,  4,  6, 12,  7
};

static BYTE MultiTableK6M13Map[8] = {
	4,  5,  7,  2,  0,  1,  3,  6
};

static BYTE MultiTableK6M13IdMap[8] = {
	4,  5,  3,  6,  0,  1,  7,  2
};

static BYTE MultiTableAthlon[32] = {
	22, 23, 24, 25, 10, 11, 12, 13,
	14, 15, 16, 17, 18, 19, 20, 21,
	50, 38, 52, 40, 26, 27, 28, 42, 
	30, 44, 32, 33, 34, 36, 46, 48
};

static BYTE MultiTableMobileAthlon[32] = {
	22, 23, 24, 25, 10, 11, 12, 13, 
	14, 15, 16, 17, 18, 19, 20, 21,
	 6, 38,  8, 40, 26, 27, 28, 42, 
	30, 44, 32, 33, 34, 36, 46, 48
};

static BYTE MultiTableMobileAthlonMap[32] = {
	16, 18,  4,  5,  6,  7,  8,  9, 
	10, 11, 12, 13, 14, 15,  0,  1,
	 2,  3, 20, 21, 22, 24, 26, 27,
	28, 29, 17, 19, 23, 25, 30, 31
};

static BYTE MultiTableMobileAthlonIdMap[32] = {
	14, 15, 16, 17,  2,  3,  4,  5,
	 6,  7,  8,  9, 10, 11, 12, 13,
	 0, 26,  1, 27, 18, 19, 20, 28,
	21, 29, 22, 23, 24, 25, 30, 31 
};
/*
static BYTE MultiTableMapAthlon[32] = {
16,
18,
4,5,6,7,8,9,10,11,12,13,14,15,
0,1,2,3,
20,21,22,
24,
26,
28,29,30,
25,
30,31
};
*/

static BYTE MultiTableCoppermine[32] = {
	10,  6,  8,  4, 11,  7,  9,  5,
	 7, 14, 16, 12,  4, 15,  3, 13,
	18, 22, 24,  4, 19, 23, 17,  5,
	 7, 14, 16, 20,  4, 15,  3, 21
};

static BYTE MultiTableTualatin[32] = {
	10,  6,  8,  4, 11,  7,  9,  5,
	32, 14, 16, 12,  4, 15,  3, 13,
	18, 22, 24,  4, 19, 23, 17,  5,
	 7, 14, 26, 20, 28, 15, 30, 21
};
/*
static BYTE MultiTableTualatin[32] = {
	24,  7,  7,  8, 11,  7, 23,  7,
	32, 14, 16, 12,  8, 15,  7, 13,
	18, 22, 24,  7, 19,  7, 17,  7,
	 7,  7, 26, 20, 28,  7, 30, 21
};
*/
static BYTE MultiTableWillamette[16] = {
	32, 34, 36, 38, 40, 42, 44, 46,
	48, 50, 52, 54, 24, 26, 28, 30
};

static BYTE MultiTableGeneric[16] = {
	10,  6,  8,  4, 11,  7,  9,  5,
	 7, 14, 16, 12,  4, 15,  3, 13
};

////////////////////////////////////////////////////////
// Voltage Table
////////////////////////////////////////////////////////

// divide by 1000 to get VID. //
static int VoltageTableDesktopAthlon[32] = {
	1850, 1825, 1800, 1775, 1750, 1725, 1700, 1675,
	1650, 1625, 1600, 1575, 1550, 1525, 1500, 1475,
	1450, 1425, 1400, 1375, 1350, 1325, 1300, 1275,
	1250, 1225, 1200, 1175, 1150, 1125, 1100,    0,
};

// divide by 1000 to get VID. //
static int VoltageTableMobileAthlon[32] = {
	2000, 1950, 1900, 1850, 1800, 1750, 1700, 1650,
	1600, 1550, 1500, 1450, 1400, 1350, 1300,    0,
	1275, 1250, 1225, 1200, 1175, 1150, 1125, 1100,
	1075, 1050, 1025, 1000,  975,  950,  925,    0
};

// divide by 10000 to get VID. //
static int VoltageTablePentium4[64] = {
	10875, 10625, 10375, 10125,  9875,  9625,  9375,  9125,
	 8875,  8625,  8375, 15875, 15625, 15375, 15125, 14875,
	14625, 14375, 14125, 13875, 13625, 13375, 13125, 12875,
	12625, 12375, 12125, 11875, 11625, 11375, 11125,     0,
	10750, 10500, 10250, 10000,  9750,  9500,  9250,  9000,
	 8750,  7500, 16000, 15750, 15500, 15250, 15000, 14750,
	14500, 14250, 14000, 13750, 13500, 13250, 13000, 12750,
	12500, 12250, 12000, 11750, 11500, 11250, 11000,     0
};

// Desktop Pentium/Core2Duo voltage constant
static const double PentiumD_Voltage_Base = 0.825;
static const double PentiumD_Voltage_Step = 0.0125;

#endif // _MULTIPLIER_TABLE_
